import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/index',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    path: '/showSYpage.html',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '首页' }
                },
                {
                    path: '/LogController/hello.html',
                    component: () => import(/* webpackChunkName: "table" */ '../components/log/LoginLogTable.vue'),
                    meta: { title: '登录日志' }
                },
                {
                    path: '/LogController/functionLog.html',
                    component: () => import(/* webpackChunkName: "table" */ '../components/log/FunLogTable.vue'),
                    meta: { title: '功能日志' }
                },
                {
                    path: '/RoleController/role_native.html',
                    component: () => import(/* webpackChunkName: "table" */ '../components/role/RoleTable.vue'),
                    meta: { title: '角色管理' }
                },
                {
                    path: '/userlist.html',
                    component: () => import(/* webpackChunkName: "table" */ '../components/user/UserTable.vue'),
                    meta: { title: '用户管理' }
                },
                {
                    path: '/menuController/showindex.html',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/menu/MenuTable'),
                    meta: { title: '菜单管理' }
                },
                {
                    path: '/NoticeController/showIndex.html',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/notice/NoticeTable.vue'),
                    meta: { title: '站内信' }
                },
                {
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    path: '/productManagerPage',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/product/ProductManager.vue'),
                    meta: { title: '商品管理' }
                },
                    {
                    path: '/tabs',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/notice/NoticeTable.vue'),
                    meta: { title: '站内信' }
                },
                {
                    path: '/productShop',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/productshop/ProductShop'),
                    meta: { title: '商城' }
                },
                {
                    path: '/showCart',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/cart/CartTable'),
                    meta: { title: '购物车' }
                },
                {
                    path:'/myOrder',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/order/OrderTable'),
                    meta: { title: '我的订单' }
                },
                {
                    path:'/showScoreChars.html',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/hongsibao/ShowScoreChars'),
                    meta: { title: '红寺堡评分图表' }
                },
                {
                    path:'/showMainClassChars.html',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/hongsibao/ShowMainClassChars'),
                    meta: { title: '红寺堡主类图表' }
                },
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        },
        {
            path: '/authError',
            redirect: '/login'//重定向登录界面
            // component: () => import(/* webpackChunkName: "login" */ '../components/page/404.vue'),
        }
    ]
});
